package com.project.design.factory.abstractFactory;

import com.project.design.factory.methodFactory.Product;

public class Client {

    public static void main(String[] args) {
        try {
            SGfarm cf = new SGfarm();
            Class<?> t = cf.getClass();
            Farm obj = (Farm) t.newInstance();
            Animal animal = obj.newAnimal();
            Plant plant = obj.newPlant();
            animal.show();
            plant.show();

        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }
    }
}
